MY_LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_PATH := $(MY_LOCAL_PATH)
LOCAL_MODULE    := hello


LOCAL_SRC_FILES := $(LOCAL_PATH)/HelloTest.cpp \
    $(LOCAL_PATH)/app_scheduler/app_task_executor.cc \
    $(LOCAL_PATH)/app_scheduler/app_task_queues.cc \
    $(LOCAL_PATH)/app_scheduler/app_task_traits.cc \
    $(LOCAL_PATH)/app_scheduler/app_ui_thread_scheduler.cc \




LOCAL_CFLAGS := -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now   -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,relro \
 -Wl,-z,defs -Wl,--as-needed -fuse-ld=lld -Wl,--color-diagnostics -Wl,--no-rosegment -Wl,--exclude-libs=libvpx_assembly_arm.a -Werror -Wl,--gdb-index -Wl,--warn-shared-textrel -Wl,-wrap,calloc -Wl,-wrap,free -Wl,-wrap,malloc -Wl,-wrap,memalign -Wl,-wrap,posix_memalign -Wl,-wrap,pvalloc -Wl,-wrap,realloc -Wl,-wrap,valloc-Wl,-z,max-page-size=4096 -Wl,-mllvm,-enable-machine-outliner=never,-Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings,-g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security  -O0 -fno-limit-debug-info  -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a
LOCAL_CFLAGS += -DNO_TCMALLOC -DCOMPONENT_BUILD -DBASE_IMPLEMENTATION -DOS_ANDROID

LOCAL_CPPFLAGS += $(LOCAL_CFLAGS)  -Wall -std=c++14

LOCAL_C_INCLUDES := $(LOCAL_PATH) \
    $(LOCAL_PATH)/../src \

LOCAL_C_INCLUDES := ./ \
                    $(LOCAL_PATH) \
                    $(LOCAL_PATH)/.. \
                    $(LOCAL_PATH)/../src \
                    $(LOCAL_PATH)/../src/chromium_header_gen/buildflags_header_gen \
                    $(LOCAL_PATH)/../src/chromium_header_gen/jni_header_gen/base/android_runtime_jni_headers/base \
                    $(LOCAL_PATH)/../src/third_party \
                    $(LOCAL_PATH)/../src./third_party/boringssl/src/include \
                    $(LOCAL_PATH)/../src/third_party/ashmem \


LOCAL_LDFLAGS := \
                -Wl,--fatal-warnings \
                -fPIC \
                -Wl,-z,noexecstack \
                -Wl,-z,relro \
                -Wl,-z,defs \
                -Wl,--as-needed \
                -fuse-ld=lld \
                -Wl,--color-diagnostics \
                -Wl,--no-rosegment \
                -Wl,--exclude-libs=libgcc.a \
                -Wl,--exclude-libs=libvpx_assembly_arm.a \
                -Werror \
                -Wl,--gdb-index \
                -Wl,--warn-shared-textrel \
                -Wl,-wrap,calloc \
                -Wl,-wrap,free \
                -Wl,-wrap,malloc \
                -Wl,-wrap,memalign \
                -Wl,-wrap,posix_memalign \
                -Wl,-wrap,pvalloc \
                -Wl,-wrap,realloc \
                -Wl,-wrap,valloc \
                -Wl,-z,max-page-size=4096 \
                -Wl,-mllvm,-enable-machine-outliner=never \


#LOCAL_LDLIBS += -llog -ldl -landroid $(LOCAL_PATH)/../src/base/android/library_loader/anchor_functions.lds
LOCAL_LDLIBS += $(LOCAL_PATH)/../src/base/android/library_loader/anchor_functions.lds -llog -ldl -landroid

$(warning  " ------------------------- LOCAL_PATH =  $(LOCAL_PATH)  LOCAL_LDLIBS =  $(LOCAL_LDLIBS) -------------------------")

LOCAL_STATIC_LIBRARIES := base

include $(BUILD_SHARED_LIBRARY)


